<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kucha\ueditor\UEditor;

/* @var $this yii\web\View */
/* @var $model common\models\Help */
/* @var $form yii\widgets\ActiveForm */
?>

<div
	class="help-form">

    <?php $form = ActiveForm::begin(); ?>

    <div class="col-xs-12 col-sm-12 col-md-12 field-goods-pid required">
		<label class="control-label" for="help-pid">上级栏目</label> <select
			id="help-pid" class="form-control" name="Help[cid]">
            <?php if(!empty($parent[0])):?>
                <?php foreach($parent[0] as $val):?>
                    <optgroup label="<?=$val['name']?>">
                        <?php if(!empty($parent[$val['id']])):?>
                        <?php foreach($parent[$val['id']] as $v):?>
                        	<option value="<?=$v['id']?>"><?=$v['name']?></option>
                        <?php endforeach;?>
                        <?php endif;?>
                    </optgroup>
                <?php endforeach;?>
            <?php endif;?>
		</select>
	</div>

    <?= $form->field($model, 'message')->widget(UEditor::className()) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
